-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: eliminate fee double-charge by using configurable decorator #9051
Conversation
Note for reviewer - please confirm that cherry-pick of agoric-labs/cosmos-sdk#407 to Agoric-v0.46.16.2.x was done correctly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but I'm unclear on the agoric-labs/cosmos-sdk tag naming convention. I also think its CHANGELOG-Agoric.md could be a bit better:
# Changelog (Agoric fork)
## Unreleased
-### Improvements
-
-* (auth) [#407](https://github.com/agoric-labs/cosmos-sdk/pull/407) Configurable fee collector module account in DeductFeeDecorator.
-
### API Breaking
* (auth, bank) Agoric/agoric-sdk#8989 Remove deprecated lien support
## `v0.46.16-alpha.agoric.2.1` - 2024-03-08
### Improvements
-* (auth) #??? Configurable fee collector module account in DeductFeeDecorator. (backport #407)
+* (auth) [#407](https://github.com/agoric-labs/cosmos-sdk/pull/407) Configurable fee collector module account in DeductFeeDecorator.
## `v0.46.16-alpha.agoric.2` - 2024-02-08
@@ -187,7 +187,7 @@ replace ( | |||
// Agoric-specific replacements: | |||
replace ( | |||
// We need a fork of cosmos-sdk until all of the differences are merged. | |||
github.com/cosmos/cosmos-sdk => github.com/agoric-labs/cosmos-sdk v0.46.16-alpha.agoric.2 | |||
github.com/cosmos/cosmos-sdk => github.com/agoric-labs/cosmos-sdk v0.46.16-alpha.agoric.2.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the new tag be v0.46.16-alpha.agoric.3? I feel like I'm missing something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.3
was already taken by future incompatible changes (waiting in the wings of an agoric-sdk PR, but I'm not sure which one). .2.1
implies the first published revision of .2
, which is more accurate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't use the current tip of Agoric
since lien support was removed in agoric-labs/cosmos-sdk#385 (in accordance with #8988, which is on master
but not cherry-picked into the upgrade-14 release branch). So we need to use a side branch of Agoric
for the new fee decorator feature. Our naming convention is to use <cosmos-release>-alpha.agoric.N
sequentially on Agoric
, ...-alpha.agoric.N.M
for sub-branches, and presumably ...N.M.P
for sub-sub-branches, etc. I'll document the policy in that repo.
golang/cosmos/ante/ante.go
Outdated
// subsumes former MempoolFeeDecorator | ||
ante.NewDeductFeeDecoratorWithName(opts.AccountKeeper, opts.BankKeeper, opts.FeegrantKeeper, nil, opts.FeeCollectorName), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like commentary for pull requests rather than permanent baggage.
// subsumes former MempoolFeeDecorator | |
ante.NewDeductFeeDecoratorWithName(opts.AccountKeeper, opts.BankKeeper, opts.FeegrantKeeper, nil, opts.FeeCollectorName), | |
ante.NewDeductFeeDecoratorWithName(opts.AccountKeeper, opts.BankKeeper, opts.FeegrantKeeper, nil, opts.FeeCollectorName), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few testing suggestions, but overall reaffirming approval.
@gibson042 Regarding |
Functionality "upstreamed" in agoric-labs/cosmos-sdk#407.
f6ba771
to
9ac6222
Compare
fix: eliminate fee double-charge by using configurable decorator
fix: eliminate fee double-charge by using configurable decorator
refs: #9036
Description
The replacement for
MempoolFeeDecorator
suggested in the cosmos-sdk 0.46 upgrade guide does not behave the same asMempoolFeeDecorator
and led to Txs being double-charged for fees.The new Cosmos 0.46
DeductFeeDecorator
subsumes the functionality of the oldDeductFeeDecorator
as well as the oldMempoolFeeDecorator
. We had created a local variation of the oldDeductFeeDecorator
with a configurable fee collector account.Instead of cloning the old
MempoolFeeDecorator
(#9045), which increases our maintenance burden, we made the newDeductFeeDecorator
configurable (agoric-labs/cosmos-sdk#407), so we'll use that instead.Security Considerations
Usual scrutiny.
Scaling Considerations
N/A
Documentation Considerations
N/A
Testing Considerations
Testing for #9045 confirmed our understanding of the double-charge,
butand further confirmation of the fix in an e2e test isdesiredavailable inagoric-sdk/a3p-integration/proposals/a:upgrade-next/ante-fees.test.js
.Upgrade Considerations
State-machine breaking, but otherwise N/A